var webpack = require('webpack');
var path = require('path');
module.exports = {
    entry: {
        index: path.resolve(__dirname,'index.js')
    },
    output: {
        path:__dirname + '/js',
        filename: './index.js'
    }, module: {
        loaders: [
            {
                test: /\.js?$/,
                exclude: /(node_modules|bower_components)/,
                loader: 'babel-loader',
                query: {
                    presets: ['es2015', 'react']
                } //将react编译成js文件
            },
            {test: /\.css$/, loader: 'style-loader!css-loader'},
            //打包css文件
            {test: /\.scss$/, loader: 'style!css!sass?sourceMap'},
            //编译sass文件
            {test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192'}
            //对图片进行打包
        ]
    }
}
